#include <AVUIAffineTransform3D.h>
#include <AVUIRotation3D.h>

namespace AVUI {

class RotateTransform3D : public AffineTransform3D
{
public:
    RotateTransform3D() { };
    RotateTransform3D(Rotation3D* pRotation) { set_Rotation(pRotation); };
    RotateTransform3D(Rotation3D* pRotation, const Point3D& center);
    ~RotateTransform3D() { }

    DECLARE_ELEMENT(RotateTransform3D, AffineTransform3D);

    DECLARE_DEPENDENCY_PROPERTY(CenterX);
    float get_CenterX() { return AVUI::UnboxValue<float>(GetValue(get_CenterXProperty())); }
    void set_CenterX(float value) { SetValue(get_CenterXProperty(), AVUI::BoxValue(value)); } 

    DECLARE_DEPENDENCY_PROPERTY(CenterY);
    float get_CenterY() { return AVUI::UnboxValue<float>(GetValue(get_CenterYProperty())); }
    void set_CenterY(float value) { SetValue(get_CenterYProperty(), AVUI::BoxValue(value)); } 

    DECLARE_DEPENDENCY_PROPERTY(CenterZ);
    float get_CenterZ() { return AVUI::UnboxValue<float>(GetValue(get_CenterZProperty())); }
    void set_CenterZ(float value) { SetValue(get_CenterZProperty(), AVUI::BoxValue(value)); } 

    DECLARE_DEPENDENCY_PROPERTY(Rotation);
    TRefCountedPtr<Rotation3D> get_Rotation() { return (Rotation3D*)(Object*)GetValue(get_RotationProperty()); }
    void set_Rotation(Rotation3D* pValue) { SetValue(get_RotationProperty(), (Object*)pValue); } 

    virtual Matrix3D get_Value();

    virtual void Append(Matrix3D* pMatrix) AVUI_OVERRIDE
    {
        *pMatrix = *pMatrix * get_Value();
    }

protected:
    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<RotateTransform3D>().get_Ptr(); }

private:
    static void StaticConstructor();

};


typedef TRefCountedPtr<RotateTransform3D> RotateTransform3DPtr;


}; // namespace AVUI
